<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:94:"D:\phpStudy\PHPTutorial\WWW\thinkphp_blog\public/../application/index\view\index\register.html";i:1560259108;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>易风博客系统</title>
    <link rel="stylesheet" type="text/css" href="/static/index/css/bootstrap.min.css">
    <script src="/static/common/js/jQuery.js"></script>
    <script src="/static/common/layer/layer.js"></script>

    <style>
        body{background-color:#31B2F3;}
        .body-center{background: #FFF;width: 450px;
            height: 500px;
            margin:60px auto;
            border-radius: 6px;
            box-shadow:0px 0px 10px #DDD;
            padding:15px;
        }
        .body-center h3,.body-center h4{margin:0;padding:0;text-align: center;}
        .body-center h3{line-height: 2.5;padding-top: 25px;color:#777}
        .body-center h4{font-size:.9em;color:#AAA;}
        form{margin:20px 25px;}
    </style>

</head>
<body>
<div class="body-center">
    <h3>易风博客系统-用户注册</h3>
    <h4>立即注册，一分钟快速搭建个人博客！</h4>
    <form action="?" id="regForm" method="post">
        <div class="form-group">
            <input type="text" class="form-control" name="account" id="account" placeholder="账号">
        </div>
        <div class="form-group">
            <input type="password" class="form-control" name="passwd" id="passwd" placeholder="密码">
        </div>
        <div class="form-group">
            <input type="password" class="form-control" name="repasswd" id="repasswd" placeholder="确认密码">
        </div>
        <div class="form-group">
            <input type="email" class="form-control" name="email" id="email" placeholder="邮箱">
        </div>
        <div class="form-group form-inline">
            <input type="text" class="form-control" id="code" name="code" placeholder="验证码" width="40px">
            <div><img src="<?php echo captcha_src(); ?>" alt="captcha" style="height: 35px;cursor: pointer" onclick="this.src='<?php echo captcha_src(); ?>?'+Math.random()" /></div>
        </div>
        <input type="button" id="btnReg" value="立即注册" class="btn btn-success btn-lg btn-block"/>
        <a href="login.html" class="btn btn-danger btn-lg btn-block">登录</a>
    </form>
    <script>
        $('#btnReg').click(function () {
            var form_data = $('#regForm').serialize();
            $.ajax({
                type:'post',
                url:"<?php echo url('index/index/register'); ?>",
                data:form_data,
                success:function (res) {
                    if(res.code==1){
                        layer.msg('注册成功',function () {
                            location.href = "<?php echo url('index/index/index'); ?>"
                        });
                    }else {
                        layer.msg('注册失败');
                    }
                }
            })
        });
    </script>
</div>

</body>
</html>
